﻿@using SCMS.Resource
@model SCMS.UI.Models.ResetPasswordModel
@{
    ViewBag.Title = Resources.PasswordReset_ChangePassword_Title;
    Layout = "~/Views/Shared/_PublicViewLayout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div id="pwdResetMain" class="contentMain">
    <div class="contentHeader">
        <div class="headerText">
            <h3 class="title-left">@Resources.PasswordReset_ChangePassword_PasswordReset</h3>
        </div>
        <div style="font-size: 13px; text-align: left;">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>                
                </tr>
            </table>
        </div>
    </div>
    <br />
    <div id="loading" style="display: none; color: Blue; font-weight: bold;">
        <img src="@Url.Content("~/Content/images/loading_indicator.gif")" alt="@Resources.Global_String_Processing" />
    </div>
    <div id="PasswordResetDiv">

        <div class="partialViewCard">
            <div class="partialViewCardHeader">
                <h3>
                    @Resources.PasswordReset_ChangePassword_ResetMyPassword
                </h3>
            </div>
            @if (Model.IsValid)
            {
                using (Html.BeginForm("ResetMyPassword", "PasswordReset", FormMethod.Post, new { @class = "form" }))
                {    
                    @Html.ValidationSummary(true)
                    <br />
                    <table width="40%" align="center" border="0" cellpadding="2" cellspacing="2">
                        <tr>
                            <td width="50%" align="right">@Resources.PasswordReset_ChangePassword_YourEmail:</td>
                            <td width="50%">
                                @Html.TextBoxFor(m => m.Email)
                                @Html.ValidationMessageFor(m => m.Email)
                            </td>
                        </tr>
                        <tr>
                            <td width="50%" align="right">@Resources.PasswordReset_ChangePassword_NewPassword:</td>
                            <td width="50%">
                                @Html.PasswordFor(m => m.Password)
                                @Html.ValidationMessageFor(m => m.Password)
                            </td>
                        </tr>
                        <tr>
                            <td width="50%" align="right">@Resources.PasswordReset_ChangePassword_ConfirmPassword:</td>
                            <td width="50%">
                                @Html.PasswordFor(m => m.ConfirmPassword)
                                @Html.ValidationMessageFor(m => m.ConfirmPassword)
                            </td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>
                                @Html.HiddenFor(m => m.PasswordResetCode)
                                <input type="submit" value="@Resources.PasswordReset_ChangePassword_ChangePassword" class="btn tertiary" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center" style="color: Red;" id="statusmsg">
                                @ViewBag.StatusMsg                    
                            </td>
                        </tr>
                    </table>
                }
            }
            else
            { 
                <br />
                <h4 style="text-align:center;">@Resources.PasswordReset_ChangePassword_SorryMsg</h4>
                <p style="text-align: center;">
                    Go to @Html.ActionLink(Resources.PasswordReset_ChangePassword_PasswordResetPage, "Index", "PasswordReset") or<br /><br />
                    Go to @Html.ActionLink(Resources.PasswordReset_ChangePassword_LoginPage, "Index", "Dashboard")
                </p>
            }            
            <br />
        </div>
    </div>
</div>